home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
031-040
/
amok32
/
patterns
/
testpatterns.mod
< prev
next >
Wrap
Text File
|
1993-11-04
|
1KB
|
42 lines
(**********************************************************************
:Program. TestPatterns.mod
:Contents. test module for Patterns
:Author. Nicolas Benezan [bne]
:Address. Postwiesenstr. 2, D7000 Stuttgart 60
:Phone. 711/333679
:Copyright. Public Domain
:Language. Modula-2
:Translator. M2Amiga A+L V3.27d
:Imports. Patterns [bne]
:History. V1.0 [bne] 01.Jan.1990
**********************************************************************)
MODULE TestPatterns;
FROM InOut IMPORT ReadString, WriteString, WriteLn;
FROM Patterns IMPORT Match;
VAR
Pattern, String: ARRAY [0..79] OF CHAR;
BEGIN
WriteString ("Pattern Test (enter empty string to quit)");
WriteLn;
WriteString ("Pattern: ");
ReadString (Pattern);
REPEAT
WriteString ("String: ");
ReadString (String);
IF Match (Pattern, String) THEN
WriteString ("matches");
ELSE
WriteString ("doesn't match");
END;
WriteLn;
UNTIL String[0] = CHR (0);
END TestPatterns.